package com.my.ycv51.ycinit.inter;


import android.graphics.Bitmap;

import com.my.ycv51.ycinit.config.DecodeConfig;
import com.my.ycv51.ycinit.config.EncodeConfig;
import com.my.ycv51.ycinit.en.DecodeType;
import com.my.ycv51.ycinit.en.EncodeType;
import com.my.ycv51.ycinit.result.DecodeResult;
import com.my.ycv51.ycinit.result.EncodeResult;

/**
 * The qr code and bar code sdk interface.
 *
 * @Author MRH
 */
public interface QrBarProvider {

    /**
     * The decoder decode image.
     *
     * @param imageBuffer The data of the image
     * @param width       The width of the image
     * @param height      The height of the image
     * @param dataType    The type of the image ,for example:YUV,JPG,PNG,BMP
     * @param config      The configuration of the decoder,if null,use default parameters.
     * @return
     */
    DecodeResult decode(byte[] imageBuffer, int width, int height, DecodeType dataType, DecodeConfig config);


    /**
     * The encoder encode string message.
     *
     * @param info        The data to be encoded
     * @param width       Width of the generated of picture
     * @param height      Height of the generated of picture
     * @param encodeType  The type of the generated picture,QR code or Bar code
     * @param logo        The picture that adding to QR code or Bar code picture
     * @param logoPercent Adjust the display size of the logo image in the original image.
     *                    The value range is [0,1]. If the logo is null, this value is invalid.
     * @param config      The configuration of the encoder,if null,use default parameters.
     * @return
     */
    EncodeResult encode(String info, int width, int height, EncodeType encodeType, Bitmap logo, float logoPercent, EncodeConfig config);
}
